<?php
/* @var $this SaleController */
/* @var $model Sale */

$this->breadcrumbs=array(
	'报表分析'=>array('data'),
	'来访人群年龄、区域、男女比例分析',
);
//设置页面标题
$this->pageTitle=Yii::app()->name.' - 来访人群年龄、区域、男女比例分析';
$this->contentTitle='来访人群年龄、区域、男女比例分析';
?>
<!-- 查询表单 -->
<?php $this->renderPartial('_search_1',array(
	'model'=>$model,
)); ?>
<!-- 查询表单 -->

<!-- 数据表格 -->
<table cellspacing="1" class="mylist2">
		<tr class="mylist_title">
			<td>省</td>
                        <td>市</td>
                        <td>区</td>
                        <td>人数</td>
                        <td>男所占比例</td>
                        <td>女所占比例</td>
                        <td>20岁以下人数</td>
                        <td>20-30岁人数</td>
                        <td>30-40岁人数</td>
                        <td>40-50岁人数</td>
                        <td>50岁以上人数</td>
                        <td>整体占比</td>
                        <td>区域占比</td>
		</tr>
	<tbody>
                <?php foreach ($queryData_1 as $key => $value) {?>
		<tr class="datalist">
                    <td><?php echo CHtml::encode($value["1"]);?></td>
                    <td><?php echo CHtml::encode($value["2"]);?></td>
                    <td><?php echo CHtml::encode($value["3"]);?></td>
                    <td><?php echo CHtml::encode($value["4"]);?></td>
                    <td><?php echo CHtml::encode($value["5"]);?></td>
                    <td><?php echo CHtml::encode($value["6"]);?></td>
                    <td><?php echo CHtml::encode($value["7"]);?></td>
                    <td><?php echo CHtml::encode($value["8"]);?></td>
                    <td><?php echo CHtml::encode($value["9"]);?></td>
                    <td><?php echo CHtml::encode($value["10"]);?></td>
                    <td><?php echo CHtml::encode($value["11"]);?></td>
                    <td><?php echo CHtml::encode($value["12"]);?></td>
                    <td><?php echo CHtml::encode($value["13"]);?></td>
		</tr>
		<?php }?>
                <tr class="datalist">
                    <td colspan="3">总计</td>
                    <td><?php echo CHtml::encode($queryData_2['$total1']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total2']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total3']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total4']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total5']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total6']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total7']);?></td>
                    <td><?php echo CHtml::encode($queryData_2['$total8']);?></td>
                    <td colspan="2"></td>
                </tr>
	</tbody>
</table>
<!-- 数据表格 -->

<!-- 数据分页 -->
<div class="mylist_foot">
    <!--<div class="fl p10 btn"><a href="javascript:deleteSelect(0);">批 量 删 除</a></div>-->
    <div class="fl p10 btn"><a href="javascript:saleExport(0);">EXCEL导出</a></div>
</div>
	<div class="pagecss fr">
	<?php $this->widget("CLinkPager", array(
        "pages" => $data->pagination,
        "header"=>"跳转到：",
        "prevPageLabel"=>"&lt; 上一页",
        "nextPageLabel"=>"&gt; 下一页",
        "firstPageLabel"=>"&lt;&lt; 首页",
        "lastPageLabel"=>"&gt;&gt; 尾页",
        "maxButtonCount"=>5,
        "footer"=>"当前页数：".($data->pagination->currentPage+1)." 总页数：".$data->pagination->pageCount." 总记录数：".$data->pagination->itemCount
    )) ?>
	</div>
</div>

<?php if(Yii::app()->user->hasFlash('success'))
        echo "<script> art.dialog({
        id: 'dialogTest',
        title: '提示信息',
        time: 5,
        icon: 'succeed',
        content: '<b>操作成功！</b><br /><br />该消息5秒后自动消失！',
        button: [
            {
                name: '确定',
                focus: true
            }]
    });</script>" 

?><!-- 数据分页 -->
<!-- 脚本 -->
<script type="text/javascript">
    function deleteSelect(id){
        ajaxSubmitdeleteSelect(id,'<?php echo Yii::app()->createUrl('sale/delete',array('id'=>0)) ?>
');
    }
    
        function saleExport(id){
        var province=$("#Party_province").val();
        var city=$("#Party_city").val();
        var area=$("#Party_area").val();

        //        if(id==0){
        //            var ids=new Array();
        //            $('input[name="id[]"]').each(function(){
        //                if($(this).attr("checked"))
        //                    ids.push($(this).val());
        //            });
        //            id=ids;
        //        }
                window.location.href="<?php echo Yii::app()->baseUrl?>/index.php/report/dataExcel?Party[province]="+province+"&Party[city]="+city
                                                                                                            +"&Party[area]="+area;
        }  
</script>
<!-- 脚本 -->
